package xxx.yyy.zzz.movie;

import java.util.Collections;
import java.util.List;

public class Movie {

    private String id;

    private String name;

    private String score;

    private List<String> type;

    private List<String> countries;

    private String plot;

    private List<String> directors;

    private List<String> writers;

    private List<String> actors;

    public Movie(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

    public List<String> getType() {
        return type == null ? Collections.EMPTY_LIST : type;
    }

    public void setType(List<String> type) {
        this.type = type;
    }

    public List<String> getCountries() {
        return countries == null ? Collections.emptyList() : countries;
    }

    public void setCountries(List<String> countries) {
        this.countries = countries;
    }

    public String getPlot() {
        return plot;
    }

    public void setPlot(String plot) {
        this.plot = plot;
    }

    public List<String> getDirectors() {
        return directors == null ? Collections.emptyList() : directors;
    }

    public void setDirectors(List<String> directors) {
        this.directors = directors;
    }

    public List<String> getWriters() {
        return writers == null ? Collections.emptyList() : writers;
    }

    public void setWriters(List<String> writers) {
        this.writers = writers;
    }

    public List<String> getActors() {
        return actors == null ? Collections.emptyList() : actors;
    }

    public void setActors(List<String> actors) {
        this.actors = actors;
    }

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("ID: ").append(id).append(System.lineSeparator());
        sb.append("片名: ").append(name).append(System.lineSeparator());
        sb.append("用户评分: ").append(score).append(System.lineSeparator());
        sb.append("国别: ");
        getCountries().forEach(token -> {
            sb.append(token);
            sb.append(" ");
        });
        sb.append(System.lineSeparator());

        sb.append("类型： ");
        getType().forEach((token) -> {
            sb.append(token);
            sb.append(" ");
        });
        sb.append(System.lineSeparator());

        sb.append("导演: ");
        getDirectors().forEach((token) -> {
            sb.append(token);
            sb.append(" ");
        });
        sb.append(System.lineSeparator());

        sb.append("编剧: ");
        getWriters().forEach((token) -> {
            sb.append(token);
            sb.append(" ");
        });
        sb.append(System.lineSeparator());

        sb.append("演员: ");
        getActors().forEach((token) -> {
            sb.append(token);
            sb.append(" ");
        });
        sb.append(System.lineSeparator());

        sb.append("剧情: ").append(plot).append(System.lineSeparator());

        return sb.toString();
    }
}
